﻿Public Class Album

	Public Property Name As String
	Friend Files As Table(Of AlbumPhoto)

	Sub Open(ByVal Name As String)
		Me.Name = Name
		Files = New Table(Of AlbumPhoto)("m:\", Name)
		Files.Open()
	End Sub

	Friend ReadOnly Property Count As Integer
		Get
			Return Files.Count
		End Get
	End Property

	Friend ReadOnly Property [Date] As Date
		Get
			Dim s = (From f In Files Select Studio.Files(f.Name).Datetime).Min
			Return New Date(Mid(s, 1, 4), Mid(s, 6, 2), Mid(s, 9, 2))
		End Get
	End Property

	Sub Delete(ByVal Name As String)
		Files.Delete(Name)
	End Sub

	Sub Save()
		Files.Save()
	End Sub

	Sub Add(ByVal Name As String)
		If Not Files.Contains(Name) Then Files.Add(Name, New AlbumPhoto(Name))
	End Sub

	Class AlbumPhoto

		Public Property Name As String

		Sub New()

		End Sub

		Sub New(ByVal Name As String)
			Me.Name = Name
		End Sub

	End Class

End Class
